<template>
  <a-config-provider :locale="locale">
    <div id="app">
      <router-view />
    </div>
  </a-config-provider>
</template>

<script>
import { setDocumentTitle } from "@/libs/utils";
import { i18nRender } from "@/locales";

export default {
  computed: {
    locale() {
      // 只是为了切换语言时，更新标题
      const { title } = this.$route.meta;
      title && setDocumentTitle(`${i18nRender(title)} - ${this.$Conf.title}`);
      return this.$i18n.getLocaleMessage(this.$store.getters.lang).antLocale;
    },
  },
};
</script>
